package com.ean.backpack.domain;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Calendar;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;

import org.apache.commons.lang3.builder.ReflectionToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import org.springframework.format.annotation.DateTimeFormat;

@Entity
@Table(name = "activepropertylist")
public class Activepropertylist implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1634315702816934353L;

	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	@Column(name = "EANHotelID")
	private Integer eanhotelId;

	public Integer getEanhotelId() {
		return this.eanhotelId;
	}

	public void setEanhotelId(Integer id) {
		this.eanhotelId = id;
	}

	@Column(name = "SequenceNumber")
	private Integer sequenceNumber;

	@Column(name = "Name", length = 70)
	private String name;

	@Column(name = "Address1", length = 50)
	private String address1;

	@Column(name = "Address2", length = 50)
	private String address2;

	@Column(name = "City", length = 50)
	private String city;

	@Column(name = "StateProvince", length = 2)
	private String stateProvince;

	@Column(name = "PostalCode", length = 15)
	private String postalCode;

	@Column(name = "Country", length = 2)
	private String country;

	@Column(name = "Latitude", precision = 8, scale = 5)
	private BigDecimal latitude;

	@Column(name = "Longitude", precision = 8, scale = 5)
	private BigDecimal longitude;

	@Column(name = "AirportCode", length = 3)
	private String airportCode;

	@Column(name = "PropertyCategory")
	private Integer propertyCategory;

	@Column(name = "PropertyCurrency", length = 3)
	private String propertyCurrency;

	@Column(name = "StarRating", precision = 2, scale = 1)
	private BigDecimal starRating;

	@Column(name = "Confidence")
	private Integer confidence;

	@Column(name = "SupplierType", length = 3)
	private String supplierType;

	@Column(name = "Location", length = 80)
	private String location;

	@Column(name = "ChainCodeID", length = 5)
	private String chainCodeId;

	@Column(name = "RegionID")
	private Integer regionId;

	@Column(name = "HighRate", precision = 19, scale = 4)
	private BigDecimal highRate;

	@Column(name = "LowRate", precision = 19, scale = 4)
	private BigDecimal lowRate;

	@Column(name = "CheckInTime", length = 10)
	private String checkInTime;

	@Column(name = "CheckOutTime", length = 10)
	private String checkOutTime;

	@Column(name = "TimeStamp")
	@NotNull
	@Temporal(TemporalType.TIMESTAMP)
	@DateTimeFormat(style = "MM")
	private Calendar timeStamp;

	public Integer getSequenceNumber() {
		return sequenceNumber;
	}

	public void setSequenceNumber(Integer sequenceNumber) {
		this.sequenceNumber = sequenceNumber;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getAddress1() {
		return address1;
	}

	public void setAddress1(String address1) {
		this.address1 = address1;
	}

	public String getAddress2() {
		return address2;
	}

	public void setAddress2(String address2) {
		this.address2 = address2;
	}

	public String getCity() {
		return city;
	}

	public void setCity(String city) {
		this.city = city;
	}

	public String getStateProvince() {
		return stateProvince;
	}

	public void setStateProvince(String stateProvince) {
		this.stateProvince = stateProvince;
	}

	public String getPostalCode() {
		return postalCode;
	}

	public void setPostalCode(String postalCode) {
		this.postalCode = postalCode;
	}

	public String getCountry() {
		return country;
	}

	public void setCountry(String country) {
		this.country = country;
	}

	public BigDecimal getLatitude() {
		return latitude;
	}

	public void setLatitude(BigDecimal latitude) {
		this.latitude = latitude;
	}

	public BigDecimal getLongitude() {
		return longitude;
	}

	public void setLongitude(BigDecimal longitude) {
		this.longitude = longitude;
	}

	public String getAirportCode() {
		return airportCode;
	}

	public void setAirportCode(String airportCode) {
		this.airportCode = airportCode;
	}

	public Integer getPropertyCategory() {
		return propertyCategory;
	}

	public void setPropertyCategory(Integer propertyCategory) {
		this.propertyCategory = propertyCategory;
	}

	public String getPropertyCurrency() {
		return propertyCurrency;
	}

	public void setPropertyCurrency(String propertyCurrency) {
		this.propertyCurrency = propertyCurrency;
	}

	public BigDecimal getStarRating() {
		return starRating;
	}

	public void setStarRating(BigDecimal starRating) {
		this.starRating = starRating;
	}

	public Integer getConfidence() {
		return confidence;
	}

	public void setConfidence(Integer confidence) {
		this.confidence = confidence;
	}

	public String getSupplierType() {
		return supplierType;
	}

	public void setSupplierType(String supplierType) {
		this.supplierType = supplierType;
	}

	public String getLocation() {
		return location;
	}

	public void setLocation(String location) {
		this.location = location;
	}

	public String getChainCodeId() {
		return chainCodeId;
	}

	public void setChainCodeId(String chainCodeId) {
		this.chainCodeId = chainCodeId;
	}

	public Integer getRegionId() {
		return regionId;
	}

	public void setRegionId(Integer regionId) {
		this.regionId = regionId;
	}

	public BigDecimal getHighRate() {
		return highRate;
	}

	public void setHighRate(BigDecimal highRate) {
		this.highRate = highRate;
	}

	public BigDecimal getLowRate() {
		return lowRate;
	}

	public void setLowRate(BigDecimal lowRate) {
		this.lowRate = lowRate;
	}

	public String getCheckInTime() {
		return checkInTime;
	}

	public void setCheckInTime(String checkInTime) {
		this.checkInTime = checkInTime;
	}

	public String getCheckOutTime() {
		return checkOutTime;
	}

	public void setCheckOutTime(String checkOutTime) {
		this.checkOutTime = checkOutTime;
	}

	public Calendar getTimeStamp() {
		return timeStamp;
	}

	public void setTimeStamp(Calendar timeStamp) {
		this.timeStamp = timeStamp;
	}

	@Override
	public String toString() {
		return ReflectionToStringBuilder.toString(this,
				ToStringStyle.SHORT_PREFIX_STYLE);
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result
				+ ((address1 == null) ? 0 : address1.hashCode());
		result = prime * result
				+ ((address2 == null) ? 0 : address2.hashCode());
		result = prime * result
				+ ((airportCode == null) ? 0 : airportCode.hashCode());
		result = prime * result
				+ ((chainCodeId == null) ? 0 : chainCodeId.hashCode());
		result = prime * result
				+ ((checkInTime == null) ? 0 : checkInTime.hashCode());
		result = prime * result
				+ ((checkOutTime == null) ? 0 : checkOutTime.hashCode());
		result = prime * result + ((city == null) ? 0 : city.hashCode());
		result = prime * result
				+ ((confidence == null) ? 0 : confidence.hashCode());
		result = prime * result + ((country == null) ? 0 : country.hashCode());
		result = prime * result
				+ ((eanhotelId == null) ? 0 : eanhotelId.hashCode());
		result = prime * result
				+ ((highRate == null) ? 0 : highRate.hashCode());
		result = prime * result
				+ ((latitude == null) ? 0 : latitude.hashCode());
		result = prime * result
				+ ((location == null) ? 0 : location.hashCode());
		result = prime * result
				+ ((longitude == null) ? 0 : longitude.hashCode());
		result = prime * result + ((lowRate == null) ? 0 : lowRate.hashCode());
		result = prime * result + ((name == null) ? 0 : name.hashCode());
		result = prime * result
				+ ((postalCode == null) ? 0 : postalCode.hashCode());
		result = prime
				* result
				+ ((propertyCategory == null) ? 0 : propertyCategory.hashCode());
		result = prime
				* result
				+ ((propertyCurrency == null) ? 0 : propertyCurrency.hashCode());
		result = prime * result
				+ ((regionId == null) ? 0 : regionId.hashCode());
		result = prime * result
				+ ((sequenceNumber == null) ? 0 : sequenceNumber.hashCode());
		result = prime * result
				+ ((starRating == null) ? 0 : starRating.hashCode());
		result = prime * result
				+ ((stateProvince == null) ? 0 : stateProvince.hashCode());
		result = prime * result
				+ ((supplierType == null) ? 0 : supplierType.hashCode());
		result = prime * result
				+ ((timeStamp == null) ? 0 : timeStamp.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Activepropertylist other = (Activepropertylist) obj;
		if (address1 == null) {
			if (other.address1 != null)
				return false;
		} else if (!address1.equals(other.address1))
			return false;
		if (address2 == null) {
			if (other.address2 != null)
				return false;
		} else if (!address2.equals(other.address2))
			return false;
		if (airportCode == null) {
			if (other.airportCode != null)
				return false;
		} else if (!airportCode.equals(other.airportCode))
			return false;
		if (chainCodeId == null) {
			if (other.chainCodeId != null)
				return false;
		} else if (!chainCodeId.equals(other.chainCodeId))
			return false;
		if (checkInTime == null) {
			if (other.checkInTime != null)
				return false;
		} else if (!checkInTime.equals(other.checkInTime))
			return false;
		if (checkOutTime == null) {
			if (other.checkOutTime != null)
				return false;
		} else if (!checkOutTime.equals(other.checkOutTime))
			return false;
		if (city == null) {
			if (other.city != null)
				return false;
		} else if (!city.equals(other.city))
			return false;
		if (confidence == null) {
			if (other.confidence != null)
				return false;
		} else if (!confidence.equals(other.confidence))
			return false;
		if (country == null) {
			if (other.country != null)
				return false;
		} else if (!country.equals(other.country))
			return false;
		if (eanhotelId == null) {
			if (other.eanhotelId != null)
				return false;
		} else if (!eanhotelId.equals(other.eanhotelId))
			return false;
		if (highRate == null) {
			if (other.highRate != null)
				return false;
		} else if (!highRate.equals(other.highRate))
			return false;
		if (latitude == null) {
			if (other.latitude != null)
				return false;
		} else if (!latitude.equals(other.latitude))
			return false;
		if (location == null) {
			if (other.location != null)
				return false;
		} else if (!location.equals(other.location))
			return false;
		if (longitude == null) {
			if (other.longitude != null)
				return false;
		} else if (!longitude.equals(other.longitude))
			return false;
		if (lowRate == null) {
			if (other.lowRate != null)
				return false;
		} else if (!lowRate.equals(other.lowRate))
			return false;
		if (name == null) {
			if (other.name != null)
				return false;
		} else if (!name.equals(other.name))
			return false;
		if (postalCode == null) {
			if (other.postalCode != null)
				return false;
		} else if (!postalCode.equals(other.postalCode))
			return false;
		if (propertyCategory == null) {
			if (other.propertyCategory != null)
				return false;
		} else if (!propertyCategory.equals(other.propertyCategory))
			return false;
		if (propertyCurrency == null) {
			if (other.propertyCurrency != null)
				return false;
		} else if (!propertyCurrency.equals(other.propertyCurrency))
			return false;
		if (regionId == null) {
			if (other.regionId != null)
				return false;
		} else if (!regionId.equals(other.regionId))
			return false;
		if (sequenceNumber == null) {
			if (other.sequenceNumber != null)
				return false;
		} else if (!sequenceNumber.equals(other.sequenceNumber))
			return false;
		if (starRating == null) {
			if (other.starRating != null)
				return false;
		} else if (!starRating.equals(other.starRating))
			return false;
		if (stateProvince == null) {
			if (other.stateProvince != null)
				return false;
		} else if (!stateProvince.equals(other.stateProvince))
			return false;
		if (supplierType == null) {
			if (other.supplierType != null)
				return false;
		} else if (!supplierType.equals(other.supplierType))
			return false;
		if (timeStamp == null) {
			if (other.timeStamp != null)
				return false;
		} else if (!timeStamp.equals(other.timeStamp))
			return false;
		return true;
	}

}
